package com.xinsoft.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinsoft.common.CountBean;
import com.xinsoft.entity.dto.ScmSaleReturnParam;
import com.xinsoft.entity.po.ScmSaleReturn;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xinsoft.entity.vo.ScmSaleReturnListVo;
import com.xinsoft.entity.vo.ScmSaleReturnVo;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
* @author ZYM
* @description 针对表【scm_sale_return(销售退货)】的数据库操作Mapper
* @createDate 2023-07-21 16:06:17
* @Entity com.xinsoft.entity.po.ScmSaleReturn
*/
public interface ScmSaleReturnMapper extends BaseMapper<ScmSaleReturn> {

    IPage<ScmSaleReturnListVo> findPageListByParam(Page<ScmSaleReturnListVo> page, ScmSaleReturnParam param);

    ScmSaleReturnVo getSaleReturnById(Integer id);

    /**
     * 获取销售退货中已用的源单物料数量
     * @param sourceIds 源单ids
     * @param sourceType 源单类型
     * @return {@link List}<{@link CountBean}>
     */
    List<CountBean> getUsedCountOfSaleReturn(@Param("sourceIds") List<Integer> sourceIds, @Param("sourceType") Integer sourceType);
}




